import {App, DirectiveBinding} from 'vue'

const actionPermission = (el: HTMLElement, binding: DirectiveBinding) => {
    el.parentNode && el.parentNode.removeChild(el)
}

export default (app: App<Element>): void => {
    app.directive('action', {
        mounted: (el, binding) => actionPermission(el, binding)
    })
}
